package com.xy.xylive.config;

import com.xylink.config.SDKConfigMgr;
import com.xylink.config.SignatureVersion;
import com.xylink.log.XyLinkLogType;
import com.xylink.util.SignUtil;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Component
@ConfigurationProperties(prefix = "xylink")
@Data
public class XylinkConf {
    private String host;
    private String enterpriseId;
    private String clientID;
    private String clientSecret;

    /**
     * 初始化sdk
     */
    @PostConstruct
    public void init() {
        SDKConfigMgr.initSDKConfig(host, clientID, clientSecret, enterpriseId, SignatureVersion.Signature_2_0, SignUtil.SignType.MD5, false,null, XyLinkLogType.LogBack);
    }
}
